
Ext.ns('designer.objects');

Ext.define('designer.objects.Panel',{
	extend:'Ext.tab.Panel',
	activeTab:0,
	title:desLang.layoutObjects,
	
	panelsTab:null,
	storesTab:null,
	modelsTab:null,
	
	controllerUrl:'',
	
	
	initComponent:function(){
			
		this.panelsTab = Ext.create('designer.objects.Tree',{
			title:desLang.panels,
			listType:'visual',
			controllerUrl:this.controllerUrl,
			listeners:{
				itemSelected:{
					fn:function(id , objectClass , showProperties){
						this.fireEvent('itemSelected' , id , objectClass , showProperties);
					},
					scope:this
				}
			}
		});
		
		this.storesTab = Ext.create('Ext.Panel',{
			title:desLang.stores
		});
		
		this.modelsTab = Ext.create('Ext.Panel',{
			title:desLang.models
		});
		
		
		this.items = [this.panelsTab , this.storesTab , this.modelsTab];
		
		this.callParent(arguments);
		
		this.addEvents(
	            /**
	             * @event dataSaved
	             * @param id
	             * @param objectClass
	             * @param title
	             */
	           'itemSelected'
	    ); 
	},
	clearData:function(){
		this.panelsTab.getStore().removeAll();
	},
	/**
	 * Load objects info
	 */
	loadInfo:function(){
		this.panelsTab.getStore().load();
	}
});